package com.hwj.mapper;

import com.hwj.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Administrator
* @description 针对表【t_comment】的数据库操作Mapper
* @createDate 2023-12-25 02:35:40
* @Entity com.hwj.entity.Comment
*/
@Mapper
public interface CommentMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Comment record);

    int insertSelective(Comment record);

    Comment selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Comment record);

    int updateByPrimaryKey(Comment record);
    List<Comment> selectForUser(Long postId);

    List<Comment> selectForChildList(Comment comment);


    @Select("select count(*) from t_comment where post_id = #{postId}")
    Long selectCount(Long postId);
}
